package com.demo.logistics.stockControl.ui;

import java.util.ArrayList;

import com.demo.logistics.R;
import com.demo.logistics.entities.Stocks;
import com.demo.logistics.stockControl.IStockListView;
import com.demo.logistics.stockControl.presenter.StockPresenter;

import android.app.ListActivity;
import android.os.Bundle;

public class StockListView extends ListActivity implements IStockListView{
	
	private StockPresenter _present;
	
	@Override
	public void onCreate(Bundle savedInstanceState){
		super.onCreate(savedInstanceState);
		_present = new StockPresenter(this);
		bindStockData();
	}

	@Override
	public void bindStockData() {
		StockListArrayAdapter slaa = new StockListArrayAdapter(this, _present.fetchAllStocks());
		setListAdapter(slaa);
	}
}
